package com.zj.java21demo.utils;

import com.zj.java21demo.vo.ResultVo;

/**
 * @Description
 * @Date 2024/1/20 11:33
 * @Created by xiaoniuhululu
 **/
public class ResultVoUtil {
    public static <T> ResultVo success(String strMsg, T object) {
        ResultVo<Object> resultVo=new ResultVo<>();
        resultVo.setCode(0);
        resultVo.setMsg(strMsg);
        resultVo.setData(object);
        return resultVo;
    }

    public static ResultVo<Object> error(Integer code, String str) {
        ResultVo<Object> resultVo=new ResultVo<>();
        resultVo.setCode(code);
        resultVo.setMsg(str);
        return resultVo;
    }


//    public static ResultVo<Object> successPage(String strMsg,Integer size,Object object) {
//        ResultVo<Object> resultVo=new ResultVo<>();
//        resultVo.setCode( 0 );
//        resultVo.setMsg( "");
//        resultVo.setCount( size );//自定义
//        resultVo.setData( object );
//        return resultVo;
//    }
}
